// 一种组合类型的方式：联合类型
type wnType= number| string

// 另一种组合类型的方式：交叉类型
type WType = number | string

interface ISWim {
    swimming: () => void
}

interface IFly {
    flying: () => void
}

type MyType1 = ISWim | IFly
type MyType2 = ISWim & IFly

const obj1: MyType1 = {
    swimming() {

    },
    // flying() {

    // }
}

const obj2: MyType2 = {
    swimming() {

    },
    flying() {
        
    }
}